﻿Imports System.Data.Linq.Mapping

Namespace DatabaseStorageDemo.Model
   <Table(Name:="Files")> _
   Public Class DatabaseFile
      <Column(Name:="ID", IsPrimaryKey:=True, IsDbGenerated:=True, CanBeNull:=False, AutoSync:=AutoSync.OnInsert)> _
      Public Property FileId() As Integer
         Get
            Return m_FileId
         End Get
         Set(value As Integer)
            m_FileId = Value
         End Set
      End Property
      Private m_FileId As Integer
      <Column(Name:="fileName", CanBeNull:=False, DbType:="nvarchar(1000)")> _
      Public Property FileName() As String
         Get
            Return m_FileName
         End Get
         Set(value As String)
            m_FileName = value
         End Set
      End Property
      Private m_FileName As String
      <Column(Name:="title", CanBeNull:=True, DbType:="nvarchar(1000)")> _
      Public Property Title() As String
         Get
            Return m_Title
         End Get
         Set(value As String)
            m_Title = Value
         End Set
      End Property
      Private m_Title As String
      <Column(Name:="subject", CanBeNull:=True, DbType:="nvarchar(1000)")> _
      Public Property Subject() As String
         Get
            Return m_Subject
         End Get
         Set(value As String)
            m_Subject = Value
         End Set
      End Property
      Private m_Subject As String
      <Column(Name:="keywords", CanBeNull:=True, DbType:="nvarchar(1000)")> _
      Public Property Keywords() As String
         Get
            Return m_Keywords
         End Get
         Set(value As String)
            m_Keywords = Value
         End Set
      End Property
      Private m_Keywords As String
      <Column(Name:="author", CanBeNull:=True, DbType:="nvarchar(1000)")> _
      Public Property Author() As String
         Get
            Return m_Author
         End Get
         Set(value As String)
            m_Author = Value
         End Set
      End Property
      Private m_Author As String
      <Column(Name:="creator", CanBeNull:=True, DbType:="nvarchar(1000)")> _
      Public Property Creator() As String
         Get
            Return m_Creator
         End Get
         Set(value As String)
            m_Creator = Value
         End Set
      End Property
      Private m_Creator As String
      <Column(Name:="pageCount", CanBeNull:=False, DbType:="int")> _
      Public Property PageCount() As Integer
         Get
            Return m_PageCount
         End Get
         Set(value As Integer)
            m_PageCount = Value
         End Set
      End Property
      Private m_PageCount As Integer
      <Column(Name:="modified", CanBeNull:=False, DbType:="datetime")> _
      Public Property LastModified() As DateTime
         Get
            Return m_LastModified
         End Get
         Set(value As DateTime)
            m_LastModified = Value
         End Set
      End Property
      Private m_LastModified As DateTime
      <Column(Name:="data", DbType:="Image", CanBeNull:=False)> _
      Public Property Data() As Byte()
         Get
            Return m_Data
         End Get
         Set(value As Byte())
            m_Data = Value
         End Set
      End Property
      Private m_Data As Byte()
   End Class
End Namespace
